import request from '@/utils/request'

// 查询bom列表
export function listBom(query) {
  return request({
    url: '/base/bom/list',
    method: 'get',
    params: query
  })
}

// 查询bom列表
export function listBomm(query) {
  return request({
    url: '/base/bom/listNumber',
    method: 'get',
    params: query
  })
}

// 查询bom列表
export function listNumber(productNumber) {
  return request({
    url: '/base/bom/Number/'+productNumber,
    method: 'get',
  })
}

// 查询bom详细
export function getBom(bomId) {
  return request({
    url: '/base/bom/' + bomId,
    method: 'get'
  })
}

// 新增bom
export function addBom(data) {
  return request({
    url: '/base/bom',
    method: 'post',
    data: data
  })
}

// 修改bom
export function updateBom(data) {
  return request({
    url: '/base/bom',
    method: 'put',
    data: data
  })
}

// 删除bom
export function delBom(bomId) {
  return request({
    url: '/base/bom/' + bomId,
    method: 'delete'
  })
}
// 删除bom
export function delBomByBomNo(bomNos) {
  return request({
    url: '/base/bom/delete/' + bomNos,
    method: 'delete'
  })
}

// 导出bom
export function exportBom(query) {
  return request({
    url: '/base/bom/export',
    method: 'get',
    params: query
  })
}